import routes from "./routes";
const context = require.context("../modules", true, /\.js/);
context
  .keys()
  .reduce((pages, file) => pages.concat(context(file).default), [])
  .forEach((route) => {
    const parentName = route.meta?.parent;
    const parentRoute = routes.find((route) => route.name === parentName);
    parentRoute?.children.push(route);
  });
export default routes;
